<div class="wrap">
  <div class="wrap-content">
    <p-panel [collapsed]="false" header="筛选查询" [collapsed]="false" headerClass="bg-none"
      [(searchText)]="searchObj.searchValue" maxlength="50" search="商品名称/商品编号/订单编号" (onSearch)="loading = true;search();dt.reset();">
      <div class="p-2-8">

        <!-- <div class="inline-block">
          <p-dropdown placeholder="请选择预警状态" styleClass="width-200 m-r-30"  [options]="isWarningStatus" [(ngModel)]="selectedWarningStatus" [ngModelOptions]="{standalone: true}"
                      optionLabel="name" (onChange)='search()'></p-dropdown>
        </div> -->

        <div class="inline-block">
          <span class="p-r-10 color-b1b1b1">状态： </span>
          <p-dropdown placeholder="全部" styleClass="width-150 m-r-20" [options]="orderStatus" [(ngModel)]="selectStatus" [ngModelOptions]="{standalone: true}"
            optionLabel="name" (onChange)='loading = true;search();dt.reset();'></p-dropdown>
        </div>

        <div class="inline-block">
          <span class="p-r-10 color-b1b1b1">配送批次： </span>
          <p-dropdown placeholder="全部" styleClass="width-150 m-r-20" [options]="materialBatch" [(ngModel)]="selectBatch" [ngModelOptions]="{standalone: true}"
            optionLabel="name" (onChange)='loading = true;search();dt.reset();'></p-dropdown>
        </div>

        <div class="inline-block">
          <span class="p-r-10 color-b1b1b1">订单商品分类： </span>
          <p-dropdown placeholder="全部" styleClass="width-150 m-r-20" [options]="orderProductTypes" [(ngModel)]="selectType" [ngModelOptions]="{standalone: true}"
                      optionLabel="name" (onChange)='loading = true;search();dt.reset();'></p-dropdown>
        </div>

        <div class="inline-block">
          <span class="p-r-10 color-b1b1b1">订单类型： </span>
          <p-dropdown placeholder="全部" styleClass="width-150 m-r-20" [options]="orderTypes" [(ngModel)]="selectOrderType" [ngModelOptions]="{standalone: true}"
                      optionLabel="name" (onChange)='loading = true;search();dt.reset();'></p-dropdown>
        </div>
      </div>
      <div class="p-t-20">
          <p-dataTable #dt [value]="listData" [totalRecords]="totalRecords" [loading]="loading" [lazy]="true" marginHeight="110"
      [paginator]="true" [(selection)]="selectedRowData" [headerCheckboxToggleAllPages]="true" (onLazyLoad)="onPage($event)">
      <p-column *ngFor="let col of colsSelected" [field]='col.field' [header]='col.header' [hidden]="col.hidden">
          <ng-template let-index="rowIndex" let-data="rowData" pTemplate="body" *ngIf="col.tem">
            <div *ngIf="col.field === 'orderCode'">
              <a class="color-1a91eb" title="{{data[col.field]}}" target="_blank" [routerLink]="['/saas/orders/readyorder/readyorder/edit', {id:data.ddOrderId}]">{{data.orderCode}}</a>
            </div>
            <div *ngIf="col.field === 'goodsCode'">
              <a class="color-1a91eb" title="{{data[col.field]}}"> {{data.goodsCode}} </a>
            </div>
            <div *ngIf="col.field === 'goodsQuantity'">
              {{data.goodsQuantity}}{{data.goodsUnit}}
            </div>
            <div *ngIf="col.field === 'batchNum'">
              {{data.batchNum ? '第'+ data.batchNum + '批' : ''}}
            </div>
          </ng-template>
          <ng-template let-index="rowIndex" let-data="rowData" pTemplate="body" *ngIf="col.dic">
            <span *ngIf="col.field == 'goodsType' || col.field == 'status' || col.field == 'orderType'"> {{storage.dicFilter(col.dic,data[col.field])}} </span>
          </ng-template>
    </p-column>
    </p-dataTable>
      </div>
    </p-panel>



  </div>
</div>
